
<!DOCTYPE HTML>
<html>
<meta http-equiv="Pragma" content="no-cache"></meta>
<meta http-equiv="Cache-Control" content="no-cache"></meta>
<meta http-equiv="Expires" content="0"></meta>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Web App">
<meta name="format-detection" content="telephone=no">
<link rel="shortcut icon" type="/image/x-icon"
	href="static/jmax/images/favicon.png">
<script src="static/cms/jquery.js" type="text/javascript"></script>
<script src="static/cms/jqueryUI/jquery-ui.js" type="text/javascript"></script>
<script src="static/cms/front.js" type="text/javascript"></script>

<link type="text/css" rel="stylesheet"
	href="static/cms/www/default/css/index.css" />
<link href="static/cms/jqueryUI/jquery.ui.css" rel="stylesheet"
	type="text/css" />
<title>JMax-CMS</title>
<!--[if lt IE 9]> 
<script src="static/cms/www/default/js/html5shiv.min.js"></script>
<script src="static/cms/www/default/js/respond.min.js"></script>
<![endif]-->

<script type="text/javascript">
	$(function() {
		// 		Cms.checkPerm("", "113");
		// 		Cms.collectCsi("", "collectCsiDiv", "collect_csi", "113");
		// 		Cms.attachment("", "113", "0", "attach");
		// 		Cms.viewCount("", "113");
		// 		Cms.siteFlow("", location.href, document.referrer, "true");
	});
</script>

<script type="text/javascript">
	jQuery(document).ready(function($) {
		$('.content-comment').click(function() {
			$('html,body').animate({
				scrollTop : $('#comments-text').offset().top
			}, 1000)
			$('#comments-text').focus();
		});
	});

	$(function() {
		//设置一个定时器，为BUTTON点击事件用
		var timer = null;
		var number1 = 0;

		//文本输入时改变
		$('#comments-text').keyup(function() {
			if (!$(this).val() == '') {
				$('.submit-on').attr("class", "submit-out");
			} else {
				$(".submit-out").attr("class", "submit-on");
			}
		});

		//处理输入的内容是文字还是字母的函数
		function getLength(str) {
			return String(str).replace(/[^\x00-\xff]/g, 'aa').length;
		}
		;

	});
</script>

<head>
<body>
	<#include "header.html">
	<div class="main container clearfix">
		<section class="message_w860">
			<h1>发表留言</h1>
			<form id="publicMsgForm">
				<div class="message_inf">
					<div class="line"></div>
					<p>
						<span>类别</span> <select name="msgType">
							<option value="fk">反馈</option>
							<option value="ts">投诉</option>
						</select>
					</p>
					<p>
						<span>邮箱</span>
						<input type="text" name="email" class="message_email" maxlength="100" />
						<span>手机号</span>
						<input type="text" name="tel" maxlength="50" class="message_phone" />
						<span style="width: auto;">QQ</span>
						<input type="text" name="qq" class="message_qq" />
					</p>
					<div class="line"></div>
					<p>
						<span>标题</span><input type="text" name="title"
							class="message_title" maxlength="255" />
					</p>
					<p>
						<span>内容</span>
						<textarea name="msgContent" cols="55" rows="4" class="message_txt"></textarea>
					</p>
					<p>
						<span>验证码</span><input type="text" name="captcha" maxlength="20"
							vld="{required:true}" class="message_code" /><img
							id="guestbookCaptcha" src="captcha.jpg?t=1234"
							onclick="this.src='captcha.jpg?t='+new Date()">
					</p>
					<p style="margin-top: 30px; position: relative;">
						<input type="hidden" name="sessionId" id="sessionId" />
						<input type="button" id="submit" class="message_btn" value="发表留言" />
						<!--<a class="tolist">查看留言列表</a>-->
					</p>
				</div>
			</form>
			<script type="text/javascript">
				$(function() {
					$("#sessionId").val($.cookie("JSESSIONID"));
					$("#submit").click(function() {
						var options = {
							url : 'cms.action?sendMsg',
							type : 'post',
							dataType : 'json',
							data : paramsToJson($("#publicMsgForm").serialize()),
							success : function(data) {
								if (data.status == 0) {
									alert("留言成功");
									location.href = location.href;
								} else if (data.status == 1) {
									alert("验证码错误");
									$("#guestbookCaptcha").click();
								}
							}
						};
						$.ajax(options);
						return false;
					});
					
					function paramsToJson(paramsAndValues) {  
					    var jsonObj = {};  
					  
					    var param = paramsAndValues.split("&");  
					    for ( var i = 0; param != null && i < param.length; i++) {  
					        var para = param[i].split("=");  
					        jsonObj[para[0]] = para[1];  
					    }  
					  
					    return jsonObj;  
					}
				});
			</script>
		</section>
		<section class="w310"><#include "hotTag.html"> 
		<#include "topTopic.html"></section>
	</div>
	<#include "footer.html">
</body>
</html>